Win32 build setup:
authorTor Lillqvist <tml@iki.fi>
Sat, 22 Jul 2000 23:50:19 +0000 (23:50 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sat, 22 Jul 2000 23:50:19 +0000 (23:50 +0000)
2000-07-23  Tor Lillqvist  <tml@iki.fi>

Win32 build setup:

* makefile.mingw.in
* pixops/makefile.mingw.in
* pixbuf_*.def: New files.

* Makefile.am
* pixops/Makefile.am: Add them. Add rule to generate makefile.mingw.

* gdk-pixbuf-io.c (gtk_win32_get_installation_directory):
New function, to get the GTK+ installation directory from
the Windows Registry, where the installation program
for whatever software includes GTK+ has stored it.

Used to avoid having hardcoding the directory where to look for
loaders. This function is needed by gtk, too, so it should
really be just in one place. Maybe a small static library
one level up from here?

* gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file)
* gdk-pixbuf-io.c (gdk_pixbuf_new_from_file):
Open file in binary mode. This *is* standard C. (No-op on Unix,
of course.)

* io-jpeg.c: If we don't HAVE_SIGSETJMP, use normal setjmp().

* io-tiff.c: Use g_get_tmp_dir(). If we don't HAVE_MKSTEMP, use
mktemp() and open().
(gdk_pixbuf__tiff_image_stop_load): g_free() also the tempname.

* pixops/*.S: The Gas from mingw32 doesn't like the .type
pseudo-op. Conditionalise on __MINGW32__, but probably
should conditionalise on Gas version instead? Or could we
do without .type on all systems?

* pixops/timescale.c: Use g_get_current_time()
instead of gettimeofday().

24 files changed:
gdk-pixbuf/ChangeLog
gdk-pixbuf/Makefile.am
gdk-pixbuf/gdk-pixbuf-animation.c
gdk-pixbuf/gdk-pixbuf-io.c
gdk-pixbuf/gdk_pixbuf.def [new file with mode: 0644]
gdk-pixbuf/io-jpeg.c
gdk-pixbuf/io-tiff.c
gdk-pixbuf/makefile.mingw.in [new file with mode: 0644]
gdk-pixbuf/pixbufloader_bmp.def [new file with mode: 0644]
gdk-pixbuf/pixbufloader_gif.def [new file with mode: 0644]
gdk-pixbuf/pixbufloader_ico.def [new file with mode: 0644]
gdk-pixbuf/pixbufloader_jpeg.def [new file with mode: 0644]
gdk-pixbuf/pixbufloader_png.def [new file with mode: 0644]
gdk-pixbuf/pixbufloader_pnm.def [new file with mode: 0644]
gdk-pixbuf/pixbufloader_ras.def [new file with mode: 0644]
gdk-pixbuf/pixbufloader_tiff.def [new file with mode: 0644]
gdk-pixbuf/pixbufloader_xpm.def [new file with mode: 0644]
gdk-pixbuf/pixops/Makefile.am
gdk-pixbuf/pixops/composite_line_22_4a4_mmx.S
gdk-pixbuf/pixops/composite_line_color_22_4a4_mmx.S
gdk-pixbuf/pixops/have_mmx.S
gdk-pixbuf/pixops/makefile.mingw.in [new file with mode: 0644]
gdk-pixbuf/pixops/scale_line_22_33_mmx.S
gdk-pixbuf/pixops/timescale.c

index db25c41080e04ea4cbb4c22be59797df84b1f2f6..bc064c67ff93823b1f00c008f8ef4fb86c3ca2a8 100644 (file)
@@ -1,3 +1,43 @@
+2000-07-23  Tor Lillqvist  <tml@iki.fi>
+
+       Win32 build setup:
+       
+       * makefile.mingw.in
+       * pixops/makefile.mingw.in
+       * pixbuf_*.def: New files.
+
+       * Makefile.am
+       * pixops/Makefile.am: Add them. Add rule to generate makefile.mingw.
+
+       * gdk-pixbuf-io.c (gtk_win32_get_installation_directory):
+       New function, to get the GTK+ installation directory from
+       the Windows Registry, where the installation program
+       for whatever software includes GTK+ has stored it.
+
+       Used to avoid having hardcoding the directory where to look for
+       loaders. This function is needed by gtk, too, so it should
+       really be just in one place. Maybe a small static library
+       one level up from here?
+
+       * gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file)
+       * gdk-pixbuf-io.c (gdk_pixbuf_new_from_file): 
+       Open file in binary mode. This *is* standard C. (No-op on Unix,
+       of course.)
+
+       * io-jpeg.c: If we don't HAVE_SIGSETJMP, use normal setjmp().
+
+       * io-tiff.c: Use g_get_tmp_dir(). If we don't HAVE_MKSTEMP, use
+       mktemp() and open().
+       (gdk_pixbuf__tiff_image_stop_load): g_free() also the tempname.
+
+       * pixops/*.S: The Gas from mingw32 doesn't like the .type
+       pseudo-op. Conditionalise on __MINGW32__, but probably
+       should conditionalise on Gas version instead? Or could we
+       do without .type on all systems?
+
+       * pixops/timescale.c: Use g_get_current_time()
+       instead of gettimeofday().
+
 Sat Jul 22 10:57:22 2000  Owen Taylor  <otaylor@redhat.com>
 
        * Makefile.am (test_gdk_pixbuf_LDADD): Remove -lgmodule
index c15c1b0bd7fa3cb64d05e08ccb464234da5f468d..9b1e5956f184013d2ade4ce0ed36725503ef157c 100644 (file)
@@ -167,3 +167,20 @@ libgdk_pixbufinclude_HEADERS =     \
 noinst_HEADERS =               \
        gdk-pixbuf-io.h         \
        gdk-pixbuf-private.h
+
+EXTRA_DIST =                   \
+       makefile.mingw          \
+       makefile.mingw.in       \
+       gdk_pixbuf.def          \
+       pixbuf_ico.def          \
+       pixbuf_pnm.def          \
+       pixbuf_xpm.def          \
+       pixbuf_bmp.def          \
+       pixbuf_jpeg.def         \
+       pixbuf_ras.def          \
+       pixbuf_gif.def          \
+       pixbuf_png.def          \
+       pixbuf_tiff.def
+
+makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gdk-pixbuf/makefile.mingw.in
+       cd $(top_builddir) && CONFIG_FILES=gdk-pixbuf/$@ CONFIG_HEADERS= $(SHELL) ./config.status
index 858becf69ef787a9c3dc74209eb73fdd437d8cdf..f6741d9387e22a379650b45844a59247e43d02ef 100644 (file)
@@ -113,7 +113,7 @@ gdk_pixbuf_animation_new_from_file (const char *filename)
 
        g_return_val_if_fail (filename != NULL, NULL);
 
-       f = fopen (filename, "r");
+       f = fopen (filename, "rb");
        if (!f)
                return NULL;
 
index 5991010393cd2d8b939a044f1ecf8f444e1b0f09..f7953434698cf4d3d378eaac70c81b5c98522955 100644 (file)
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"
 
+#ifdef G_OS_WIN32
+#define STRICT
+#include <windows.h>
+#endif
+
 \f
 
 static gboolean
@@ -194,6 +199,65 @@ pixbuf_module_symbol (GModule *module, const char *module_name, const char *symb
        return return_value;
 }
 
+#ifdef G_OS_WIN32
+
+/* What would be the right place for this function? Also
+ * gtk needs this function (to find the gtkrc and themes).
+ * But it seems stupid for the gdk-pixbuf DLL to depend
+ * on the gtk DLL. Should it be in the gdk DLL? Or should we
+ * have a small static library at the top gtk+ level?
+ */
+
+static gchar *
+gtk_win32_get_installation_directory (void)
+{
+  static gboolean been_here = FALSE;
+  static gchar gtk_installation_dir[200];
+  gchar win_dir[100];
+  HKEY reg_key = NULL;
+  DWORD type;
+  DWORD nbytes = sizeof (gtk_installation_dir);
+
+  if (been_here)
+    return gtk_installation_dir;
+
+  been_here = TRUE;
+
+  if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "Software\\GNU\\GTk+", 0,
+                   KEY_QUERY_VALUE, &reg_key) != ERROR_SUCCESS
+      || RegQueryValueEx (reg_key, "InstallationDirectory", 0,
+                         &type, gtk_installation_dir, &nbytes) != ERROR_SUCCESS
+      || type != REG_SZ)
+    {
+      /* Uh oh. Use hard-coded %WinDir%\gtk+ value */
+      GetWindowsDirectory (win_dir, sizeof (win_dir));
+      sprintf (gtk_installation_dir, "%s\\gtk+", win_dir);
+    }
+
+  if (reg_key != NULL)
+    RegCloseKey (reg_key);
+
+  return gtk_installation_dir;
+}
+
+static char *
+get_libdir (void)
+{
+  static char *libdir = NULL;
+
+  if (libdir == NULL)
+    libdir = g_strdup_printf (gtk_win32_get_installation_directory (),
+                             G_DIR_SEPARATOR_S,
+                             "loaders",
+                             NULL);
+
+  return libdir;
+}
+
+#define PIXBUF_LIBDIR get_libdir ()
+
+#endif
+
 /* actually load the image handler - gdk_pixbuf_get_module only get a */
 /* reference to the module to load, it doesn't actually load it       */
 /* perhaps these actions should be combined in one function           */
@@ -422,7 +486,7 @@ gdk_pixbuf_new_from_file (const char *filename)
 
        g_return_val_if_fail (filename != NULL, NULL);
 
-       f = fopen (filename, "r");
+       f = fopen (filename, "rb");
        if (!f)
                return NULL;
 
diff --git a/gdk-pixbuf/gdk_pixbuf.def b/gdk-pixbuf/gdk_pixbuf.def
new file mode 100644 (file)
index 0000000..546e3bc
--- /dev/null
@@ -0,0 +1,42 @@
+EXPORTS
+       gdk_pixbuf_add_alpha
+       gdk_pixbuf_animation_get_frames
+       gdk_pixbuf_animation_get_height
+       gdk_pixbuf_animation_get_num_frames
+       gdk_pixbuf_animation_get_type
+       gdk_pixbuf_animation_get_width
+       gdk_pixbuf_animation_new_from_file
+       gdk_pixbuf_animation_ref
+       gdk_pixbuf_animation_unref
+       gdk_pixbuf_composite
+       gdk_pixbuf_composite_color
+       gdk_pixbuf_composite_color_simple
+       gdk_pixbuf_copy
+       gdk_pixbuf_copy_area
+       gdk_pixbuf_frame_get_action
+       gdk_pixbuf_frame_get_delay_time
+       gdk_pixbuf_frame_get_pixbuf
+       gdk_pixbuf_frame_get_x_offset
+       gdk_pixbuf_frame_get_y_offset
+       gdk_pixbuf_get_bits_per_sample
+       gdk_pixbuf_get_colorspace
+       gdk_pixbuf_get_has_alpha
+       gdk_pixbuf_get_height
+       gdk_pixbuf_get_module
+       gdk_pixbuf_get_n_channels
+       gdk_pixbuf_get_pixels
+       gdk_pixbuf_get_rowstride
+       gdk_pixbuf_get_type
+       gdk_pixbuf_get_width
+       gdk_pixbuf_init
+       gdk_pixbuf_load_module
+       gdk_pixbuf_new
+       gdk_pixbuf_new_from_data
+       gdk_pixbuf_new_from_file
+       gdk_pixbuf_new_from_xpm_data
+       gdk_pixbuf_postinit
+       gdk_pixbuf_preinit
+       gdk_pixbuf_ref
+       gdk_pixbuf_scale
+       gdk_pixbuf_scale_simple
+       gdk_pixbuf_unref
index ed3ee2ac8e444b25af7e3e4b4f1b4c95fec3c984..6a9ffe7d300c26c16c34396f95452121c7bde088 100644 (file)
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"
 
+#ifndef HAVE_SIGSETJMP
+#define sigjmp_buf jmp_buf
+#define sigsetjmp(jb, x) setjmp(jb)
+#define siglongjmp longjmp
+#endif
 \f
 
 /* we are a "source manager" as far as libjpeg is concerned */
index 602adb8468c31f10e0fc0d11fc5ee2d3fa4868ce..3dd397fda2872609d508d75d1aa6c19bf8cf370d 100644 (file)
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"
 
+#ifdef G_OS_WIN32
+#include <fcntl.h>
+#define O_RDWR _O_RDWR
+#endif
 \f
 
 typedef struct _TiffData TiffData;
@@ -146,14 +150,24 @@ gdk_pixbuf__tiff_image_begin_load (ModulePreparedNotifyFunc prepare_func,
 {
        TiffData *context;
        gint fd;
+       gchar *tmp = g_get_tmp_dir ();
 
        context = g_new (TiffData, 1);
        context->prepare_func = prepare_func;
        context->update_func = update_func;
        context->user_data = user_data;
        context->all_okay = TRUE;
-       context->tempname = g_strdup ("/tmp/gdkpixbuf-tif-tmp.XXXXXX");
+       context->tempname =
+         g_strconcat (tmp,
+                      tmp[strlen (tmp)] == G_DIR_SEPARATOR ? G_DIR_SEPARATOR_S : "",
+                      "gdkpixbuf-tif-tmp.XXXXXX",
+                      NULL);
+#ifdef HAVE_MKSTEMP
        fd = mkstemp (context->tempname);
+#else
+       mktemp (context->tempname);
+       fd = open (context->tempname, O_RDWR);
+#endif
        if (fd < 0) {
                g_free (context);
                return NULL;
@@ -182,6 +196,7 @@ gdk_pixbuf__tiff_image_stop_load (gpointer data)
 
        fclose (context->file);
        unlink (context->tempname);
+       g_free (context->tempname);
        g_free ((TiffData *) context);
 }
 
diff --git a/gdk-pixbuf/makefile.mingw.in b/gdk-pixbuf/makefile.mingw.in
new file mode 100644 (file)
index 0000000..08944ec
--- /dev/null
@@ -0,0 +1,109 @@
+## Makefile for building the gdk_pixbuf DLL with gcc on Win32
+## Use: make -f makefile.mingw
+
+TOP = ../..
+
+include ../build/win32/make.mingw
+
+# Possibly override GTK+ version from build/win32/module.defs
+GTK_VER = @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@
+
+OPTIMIZE = -g
+
+INCLUDES = -I . -I .. 
+DEPCFLAGS = $(GLIB_CFLAGS)
+
+all :                                          \
+       ../config.h                             \
+       gdk_pixbuf-$(GTK_VER).dll               \
+       pixbufloader_png.dll                    \
+       pixbufloader_jpeg.dll                   \
+       pixbufloader_gif.dll                    \
+       pixbufloader_ico.dll                    \
+       pixbufloader_ras.dll                    \
+       pixbufloader_tiff.dll                   \
+       pixbufloader_xpm.dll                    \
+       pixbufloader_pnm.dll                    \
+       pixbufloader_bmp.dll                    \
+       test-gdk-pixbuf.exe
+       
+gdk_pixbuf_OBJECTS =                           \
+       gdk-pixbuf.o                            \
+       gdk-pixbuf-animation.o                  \
+       gdk-pixbuf-data.o                       \
+       gdk-pixbuf-io.o                         \
+       gdk-pixbuf-scale.o                      \
+       gdk-pixbuf-util.o                       \
+       pixops/libpixops.a
+
+../config.h : ../config.h.win32
+       cp $< $@
+
+gdk_pixbuf-$(GTK_VER).dll : $(gdk_pixbuf_OBJECTS) gdk_pixbuf.def
+       $(GLIB)/build-dll gdk_pixbuf $(GTK_VER) gdk_pixbuf.def $(gdk_pixbuf_OBJECTS) -L ../gdk -lgdk-$(GTK_VER) $(GLIB_LIBS)
+
+pixops/libpixops.a :
+       cd pixops && $(MAKE) -f makefile.mingw libpixops.a
+
+pixbufloader_png_OBJECTS = io-png.o
+
+pixbufloader_png.dll : $(pixbufloader_png_OBJECTS) pixbufloader_png.def
+       $(GLIB)/build-dll pixbufloader_png - pixbuf_png.def $(pixbufloader_png_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS) $(PNG_LIBS)
+
+io-png.o : io-png.c
+       $(CC) $(CFLAGS) $(PNG_CFLAGS) -c $<
+
+pixbufloader_jpeg_OBJECTS = io-jpeg.o
+
+pixbufloader_jpeg.dll : $(pixbufloader_jpeg_OBJECTS) pixbufloader_jpeg.def
+       $(GLIB)/build-dll pixbufloader_jpeg - pixbuf_jpeg.def $(pixbufloader_jpeg_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS) $(JPEG_LIBS)
+
+io-jpeg.o : io-jpeg.c
+       $(CC) $(CFLAGS) $(JPEG_CFLAGS) -c $<
+
+pixbufloader_gif_OBJECTS = io-gif.o
+
+pixbufloader_gif.dll : $(pixbufloader_gif_OBJECTS) pixbufloader_gif.def
+       $(GLIB)/build-dll pixbufloader_gif - pixbuf_gif.def $(pixbufloader_gif_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+pixbufloader_ico_OBJECTS = io-ico.o
+
+pixbufloader_ico.dll : $(pixbufloader_ico_OBJECTS) pixbufloader_ico.def
+       $(GLIB)/build-dll pixbufloader_ico - pixbuf_ico.def $(pixbufloader_ico_OBJECTS) -L  . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+pixbufloader_ras_OBJECTS = io-ras.o
+
+pixbufloader_ras.dll : $(pixbufloader_ras_OBJECTS) pixbufloader_ras.def
+       $(GLIB)/build-dll pixbufloader_ras - pixbuf_ras.def $(pixbufloader_ras_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+pixbufloader_tiff_OBJECTS = io-tiff.o
+
+pixbufloader_tiff.dll : $(pixbufloader_tiff_OBJECTS) pixbufloader_tiff.def
+       $(GLIB)/build-dll pixbufloader_tiff - pixbuf_tiff.def $(pixbufloader_tiff_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(ZLIB_LIBS)
+
+io-tiff.o : io-tiff.c
+       $(CC) $(CFLAGS) $(TIFF_CFLAGS) -c $<
+
+pixbufloader_xpm_OBJECTS = io-xpm.o
+
+pixbufloader_xpm.dll : $(pixbufloader_xpm_OBJECTS) pixbufloader_xpm.def
+       $(GLIB)/build-dll pixbufloader_xpm - pixbuf_xpm.def $(pixbufloader_xpm_OBJECTS) -L  . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+pixbufloader_pnm_OBJECTS = io-pnm.o
+
+pixbufloader_pnm.dll : $(pixbufloader_pnm_OBJECTS) pixbufloader_pnm.def
+       $(GLIB)/build-dll pixbufloader_pnm - pixbuf_pnm.def $(pixbufloader_pnm_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+pixbufloader_bmp_OBJECTS = io-bmp.o
+
+pixbufloader_bmp.dll : $(pixbufloader_bmp_OBJECTS) pixbufloader_bmp.def
+       $(GLIB)/build-dll pixbufloader_bmp - pixbuf_bmp.def $(pixbufloader_bmp_OBJECTS) -L . -lgdk_pixbuf-$(GTK_VER) $(GLIB_LIBS)
+
+test-gdk-pixbuf.exe : test-gdk-pixbuf.o gdk_pixbuf-$(GTK_VER).dll
+       $(CC) $(CFLAGS) -o $@ test-gdk-pixbuf.o -L . -lgdk_pixbuf-$(GTK_VER) $(GTK_LIBS) $(GLIB_LIBS)
+
+# Hack to get an updated makefile.mingw automatically after updating
+# makefile.mingw.in. Only for developer use.
+makefile.mingw: makefile.mingw.in
+       sed -e 's,@GTK_MAJOR[_]VERSION@,@GTK_MAJOR_VERSION@,' \
+           -e 's,@GTK_MINOR[_]VERSION@,@GTK_MINOR_VERSION@,' <$< >$@
diff --git a/gdk-pixbuf/pixbufloader_bmp.def b/gdk-pixbuf/pixbufloader_bmp.def
new file mode 100644 (file)
index 0000000..f11d3f3
--- /dev/null
@@ -0,0 +1,5 @@
+EXPORTS
+       gdk_pixbuf__bmp_image_load
+       gdk_pixbuf__bmp_image_begin_load
+       gdk_pixbuf__bmp_image_stop_load
+       gdk_pixbuf__bmp_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_gif.def b/gdk-pixbuf/pixbufloader_gif.def
new file mode 100644 (file)
index 0000000..28ed9b7
--- /dev/null
@@ -0,0 +1,6 @@
+EXPORTS
+       gdk_pixbuf__gif_image_load
+       gdk_pixbuf__gif_image_begin_load
+       gdk_pixbuf__gif_image_stop_load
+       gdk_pixbuf__gif_image_load_increment
+       gdk_pixbuf__gif_image_load_animation
diff --git a/gdk-pixbuf/pixbufloader_ico.def b/gdk-pixbuf/pixbufloader_ico.def
new file mode 100644 (file)
index 0000000..6bc5257
--- /dev/null
@@ -0,0 +1,5 @@
+EXPORTS
+       gdk_pixbuf__ico_image_load
+       gdk_pixbuf__ico_image_begin_load
+       gdk_pixbuf__ico_image_stop_load
+       gdk_pixbuf__ico_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_jpeg.def b/gdk-pixbuf/pixbufloader_jpeg.def
new file mode 100644 (file)
index 0000000..ee673b3
--- /dev/null
@@ -0,0 +1,5 @@
+EXPORTS
+       gdk_pixbuf__jpeg_image_load
+       gdk_pixbuf__jpeg_image_begin_load
+       gdk_pixbuf__jpeg_image_stop_load
+       gdk_pixbuf__jpeg_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_png.def b/gdk-pixbuf/pixbufloader_png.def
new file mode 100644 (file)
index 0000000..4247370
--- /dev/null
@@ -0,0 +1,5 @@
+EXPORTS
+       gdk_pixbuf__png_image_load
+       gdk_pixbuf__png_image_begin_load
+       gdk_pixbuf__png_image_stop_load
+       gdk_pixbuf__png_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_pnm.def b/gdk-pixbuf/pixbufloader_pnm.def
new file mode 100644 (file)
index 0000000..b708d1c
--- /dev/null
@@ -0,0 +1,5 @@
+EXPORTS
+       gdk_pixbuf__pnm_image_load
+       gdk_pixbuf__pnm_image_begin_load
+       gdk_pixbuf__pnm_image_stop_load
+       gdk_pixbuf__pnm_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_ras.def b/gdk-pixbuf/pixbufloader_ras.def
new file mode 100644 (file)
index 0000000..a4e3e04
--- /dev/null
@@ -0,0 +1,5 @@
+EXPORTS
+       gdk_pixbuf__ras_image_load
+       gdk_pixbuf__ras_image_begin_load
+       gdk_pixbuf__ras_image_stop_load
+       gdk_pixbuf__ras_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_tiff.def b/gdk-pixbuf/pixbufloader_tiff.def
new file mode 100644 (file)
index 0000000..264d50a
--- /dev/null
@@ -0,0 +1,5 @@
+EXPORTS
+       gdk_pixbuf__tiff_image_load
+       gdk_pixbuf__tiff_image_begin_load
+       gdk_pixbuf__tiff_image_stop_load
+       gdk_pixbuf__tiff_image_load_increment
diff --git a/gdk-pixbuf/pixbufloader_xpm.def b/gdk-pixbuf/pixbufloader_xpm.def
new file mode 100644 (file)
index 0000000..45bf96c
--- /dev/null
@@ -0,0 +1,3 @@
+EXPORTS
+       gdk_pixbuf__xpm_image_load
+       gdk_pixbuf__xpm_image_load_xpm_data
index 5fe5fd5464623167893e7e9a394913f19f43384b..f799f42ffc028a4f455c7a4bd65d7da75b1f0ae2 100644 (file)
@@ -22,4 +22,10 @@ libpixops_la_SOURCES =               \
        $(mmx_sources)
 
 EXTRA_DIST =                           \
-       DETAILS
\ No newline at end of file
+       DETAILS                         \
+       makefile.mingw                  \
+       makefile.mingw.in
+
+makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gdk-pixbuf/pixops/makefile.mingw.in
+       cd $(top_builddir) && CONFIG_FILES=gdk-pixbuf/pixops/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
index f3edc8ab083804d4fd1a2f243b28723e468d3667..3b3c2c472b3e715a5b338c4edbe8a515f0cd103a 100644 (file)
@@ -3,8 +3,19 @@
 gcc2_compiled.:
 .text
        .align 16
+
+#ifndef __MINGW32__
+       
 .globl pixops_composite_line_22_4a4_mmx
        .type    pixops_composite_line_22_4a4_mmx,@function
+pixops_composite_line_22_4a4_mmx:
+       
+#else
+       
+.globl _pixops_composite_line_22_4a4_mmx
+_pixops_composite_line_22_4a4_mmx:
+       
+#endif
 /*
  * Arguments
  *             
@@ -17,7 +28,6 @@ gcc2_compiled.:
  * xinit:       32(%ebp)
  *     
 */
-pixops_composite_line_22_4a4_mmx:
 /*
  * Function call entry
  */
index e3fd640d65a28aeecab8995ac90b388e8bea94cb..28d2c8b8524ffed9682bc77de525b6ae05de3be9 100644 (file)
@@ -3,8 +3,19 @@
 gcc2_compiled.:
 .text
        .align 16
+
+#ifndef __MINGW32__
+
 .globl pixops_composite_line_color_22_4a4_mmx
        .type    pixops_composite_line_color_22_4a4_mmx,@function
+pixops_composite_line_color_22_4a4_mmx:
+
+#else
+
+.globl _pixops_composite_line_color_22_4a4_mmx
+_pixops_composite_line_color_22_4a4_mmx:
+       
+#endif
 /*
  * Arguments
  *             
@@ -20,7 +31,7 @@ gcc2_compiled.:
  * colors:     44(%ebp)
  *     
 */
-pixops_composite_line_color_22_4a4_mmx:
+
 /*
  * Function call entry
  */
index da222500fe1df905c421d4cff90017bd273cbb58..f777fb89cdc215188240f10828587899c29de494 100644 (file)
@@ -3,10 +3,20 @@
 gcc2_compiled.:
 .text
        .align 16
+
+#ifndef __MINGW32__
+
 .globl pixops_have_mmx
        .type    pixops_have_mmx,@function
-
 pixops_have_mmx:
+
+#else
+
+.globl _pixops_have_mmx
+_pixops_have_mmx:
+
+#endif
+       
        push    %ebx
 
 # Check if bit 21 in flags word is writeable
diff --git a/gdk-pixbuf/pixops/makefile.mingw.in b/gdk-pixbuf/pixops/makefile.mingw.in
new file mode 100644 (file)
index 0000000..42e8fae
--- /dev/null
@@ -0,0 +1,40 @@
+## Makefile for building libpixops.a with gcc on Win32
+## Use: make -f makefile.mingw
+
+TOP = ../../..
+
+include $(TOP)/build/win32/make.mingw
+
+# Possibly override GTK+ version from build/win32/module.defs
+GTK_VER = @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@
+
+OPTIMIZE = -g
+
+INCLUDES = -I .. -I ../..
+DEPCFLAGS = $(GLIB_CFLAGS) $(PNG_CFLAGS) $(ZLIB_CFLAGS) $(JPEG_CLFAGS) $(TIFF_CFLAGS)
+
+all :                                          \
+       ../../config.h                          \
+       libpixops.a                             \
+       timescale.exe
+
+libpixops_OBJECTS =                            \
+       pixops.o                                \
+       have_mmx.o                              \
+       scale_line_22_33_mmx.o                  \
+       composite_line_22_4a4_mmx.o             \
+       composite_line_color_22_4a4_mmx.o
+
+../../config.h : ../../config.h.win32
+       cp $< $@
+
+libpixops.a : $(libpixops_OBJECTS)
+       ar rv $@ $?
+
+timescale.exe : timescale.o libpixops.a
+       $(CC) $(CFLAGS) -o $@ timescale.o libpixops.a $(GLIB_LIBS)
+
+makefile.mingw: makefile.mingw.in
+       sed -e 's,@GTK_MAJOR[_]VERSION@,@GTK_MAJOR_VERSION@,' \
+           -e 's,@GTK_MINOR[_]VERSION@,@GTK_MINOR_VERSION@,' <$< >$@
+
index e253fc18899c3e561b624d7938396b2050e7a4de..40dec48d3ea4bbcbceb6c009e62438c3606c8a40 100644 (file)
@@ -3,8 +3,19 @@
 gcc2_compiled.:
 .text
        .align 16
+
+#ifndef __MINGW32__
+       
 .globl pixops_scale_line_22_33_mmx
        .type    pixops_scale_line_22_33_mmx,@function
+pixops_scale_line_22_33_mmx:
+       
+#else
+       
+.globl _pixops_scale_line_22_33_mmx
+_pixops_scale_line_22_33_mmx:
+       
+#endif
 /*
  * Arguments
  *             
@@ -17,7 +28,7 @@ gcc2_compiled.:
  * xinit:       32(%ebp)
  *     
 */
-pixops_scale_line_22_33_mmx:
+
 /*
  * Function call entry
  */
index b835ff5424f5f4afb82b5d7c5df91c9b520c2d85..f3c9045667028851199bd43e14907c1399e0b711 100644 (file)
@@ -1,24 +1,24 @@
-#include <unistd.h>
+#include <glib.h>
 #include <string.h>
-#include <sys/time.h>
 #include <stdlib.h>
 #include <stdio.h>
+
 #include "pixops.h"
 
-struct timeval start_time;
+static GTimeVal start_time;
 
 void start_timing (void)
 {
-  gettimeofday (&start_time, NULL);
+  g_get_current_time (&start_time);
 }
 
 double
 stop_timing (const char *test, int iterations, int bytes)
 {
-  struct timeval stop_time;
+  GTimeVal stop_time;
   double msecs;
   
-  gettimeofday (&stop_time, NULL);
+  g_get_current_time (&stop_time);
   if (stop_time.tv_usec < start_time.tv_usec)
     {
       stop_time.tv_usec += 1000000;